% File R/myBam.R
\name{em.countBam}
\alias{em.countBam}
\title{em.countBam}
\description{
  Returns a count of records consistent with \code{param}.
}
\usage{
em.countBam(file, query, index=file, seqs=NULL, ...)
}
\arguments{
  \item{file}{The character(1) file name of the `BAM'
    file to be processed.}
  \item{index}{The character(1) name of the index file of the 'BAM' file
    being processed; this is given _without_ the '.bai'
    extension.}
  \item{query}{An extension of  ‘ScanBamParam’. This defines the
    selection condition of the query, what fields
    and which records are imported.}
  \item{seqs}{The character() reference (‘targets’) names where the
    count will be performed. By default  all targets in the BAM header
    are used and each target is processed in parallel.}
}
\seealso{
  \code{\link{Rsamtools}}.
}
\examples{
library(emBAM)

bam.file <- system.file("extdata", "toy.bam", package="emBAM")
# all alignments with a simple cigar
query <- em.query("Alignments with simple cigar")
# list
num.alignments <- em.countBam(bam.file,query)

print(num.alignments)
#  space start end width    file records nucleotides
#1    NA    NA  NA    NA toy.bam       6         122

}
\keyword{file}